# -*_ codeing=utf-8 -*-
# @Time: 2024/9/6 14:59
# @Author: foxhuty
# @File: equation_test.py
# @Software: PyCharm
# @Based on python 3.10
# from sympy import solve, symbols
import sympy as sp


def get_added_score():
    t = sp.symbols('t')
    y = 80
    t1 = 78
    t2 = 90
    y1 = 67
    y2 = 82
    # 新高考赋分方法，其中y为原始卷面分，t为赋值得分，t1和t2为所在等级赋值区间的下限和上限，y1和y2为卷面所在等级分数区间的下限和上限。
    # 当y=y1时，t=t1
    if y == y1:
        t = t1
        print(f'原始卷面分为：{y}，赋值后的分数为：{t}')
    else:
        scores_added = sp.solve((t2 - t) / (t - t1) - (y2 - y) / (y - y1), t)
        print(f'原始卷面分为：{y}，赋值后的分数为：{scores_added[0]},取整后得分为：{round(scores_added[0])}')


x, y = sp.symbols('x y')
# result = factor(x ** 2 + 2 * x * y + y ** 2)
# res = together(1 + 2 / (x - 1))
# print(res)
# print(factor(x ** 3 - 3 * x ** 2 + 3 * x - 1))
get_added_score()
eq1 = sp.Eq(x ** 2 + 4 * x, 4)
solutions1 = sp.solve(eq1, x)
print(solutions1)
